package com.jty.lib_base.data.source

import com.jty.lib_base.api.ApiService
import com.jty.lib_base.base.BaseBean
import com.jty.lib_base.data.bean.*
import io.reactivex.Observable
import okhttp3.RequestBody


/**
 * author: zhouyh
 * created on: 2021/5/11 11:22 下午
 * description:网络数据请求实现类
 */
class HttpDataImpl(private val apiService: ApiService):HttpDataSource{



    override fun login(requestBody: RequestBody): Observable<BaseBean<LoginBean>> {
        return apiService.login(requestBody)
    }


    override fun getToken(
        grant_type: String, client_id: String, client_secret: String, device_type: String,
        account: String, password: String,
    ): Observable<BaseBean<TokenBean>> {
        return apiService.getToken(grant_type,client_id,client_secret,device_type, account,password)
    }

    override fun getCode(requestBody: RequestBody): Observable<BaseBean<String>> {
        return apiService.sendMsgCode(requestBody)
    }


    override fun rePassword(requestBody: RequestBody): Observable<BaseBean<Any?>> {
        return apiService.resetPassword(requestBody)
    }


    override fun getUserInfo(): Observable<BaseBean<UserInfoBean>> {
        return apiService.getUserInfo()
    }

    override fun modifyUserInfo(requestBody: RequestBody): Observable<BaseBean<Any?>> {
        return apiService.modifyUserInfo(requestBody)
    }

    override fun modifyPhone(requestBody: RequestBody): Observable<BaseBean<Any?>> {
        return apiService.modifyPhone(requestBody)
    }

    override fun getSchoolPhaseSubjectList(requestBody: RequestBody): Observable<BaseBean<List<UserInfoBean>>> {
        return apiService.getSchoolPhaseSubjectList(requestBody)
    }


    override fun modifyPassword(requestBody: RequestBody): Observable<BaseBean<Any?>> {
        return apiService.modifyPassword(requestBody)
    }


    override fun querySection(): Observable<BaseBean<List<SectionBean>>> {
        return apiService.querySection()
    }

    override fun querySubject(): Observable<BaseBean<List<SubjectBean>>> {
       return apiService.querySubject()
    }

    override fun getTeacherPen(): Observable<BaseBean<TeacherPenBean>> {
        return apiService.getTeacherPen()
    }

    override fun pageBybookNote(requestBody: RequestBody): Observable<BaseBean<PageBybookNoteBean>> {
        return apiService.pageBybookNote(requestBody)
    }

    override fun bookNoteByTeacherId(requestBody: RequestBody): Observable<BaseBean<List<GridPictureBean>>> {
        return apiService.bookNoteByTeacherId(requestBody)
    }

    override fun getNoteTemplateInfo1(requestBody: RequestBody): Observable<BaseBean<BookNoteBean>> {
        return apiService.getNoteTemplateInfo1(requestBody)
    }

    override fun commitTeacherBookNote(requestBody: RequestBody): Observable<BaseBean<Any?>> {
        return apiService.commitTeacherBookNote(requestBody)
    }

    override fun commitTeacherBookNoteOnLine(requestBody: RequestBody): Observable<BaseBean<Any?>> {
        return apiService.commitTeacherBookNoteOnLine(requestBody)
    }

    override fun createTeacherWriteRecord(requestBody: RequestBody): Observable<BaseBean<Any?>> {
        return apiService.createTeacherWriteRecord(requestBody)
    }

    override fun checkTeacherMac(requestBody: RequestBody): Observable<BaseBean<CheckTeacherMacBean>> {
        return apiService.checkTeacherMac(requestBody)
    }

    override fun getOneNoteTemplateInfo(requestBody: RequestBody): Observable<BaseBean<GridPictureBean>> {
        return apiService.getOneNoteTemplateInfo(requestBody)
    }



    override fun teacherConfirmConnect(requestBody: RequestBody): Observable<BaseBean<Any?>> {
        return apiService.teacherConfirmConnect(requestBody)
    }

    override fun queryLastVersion(version: String): Observable<BaseBean<VersionInfoBean>> {
        return apiService.queryLastVersion(version)
    }


    override fun getResearchTabData(requestBody: RequestBody): Observable<BaseBean<List<ResearchTabBean>>> {
        return apiService.getResearchTabData(requestBody)
    }

    override fun queryResearchActivity(requestBody: RequestBody): Observable<BaseBean<ResearchActivityListBean>> {
        return apiService.queryResearchActivity(requestBody)
    }

    override fun getResearchActivityDetail(requestBody: RequestBody): Observable<BaseBean<ResearchDetailBean>> {
        return apiService.getResearchActivityDetail(requestBody)
    }

    override fun getResearchJoinPeople(requestBody: RequestBody): Observable<BaseBean<List<ResearchJoinPeopleBean>>> {
        return apiService.getResearchJoinPeople(requestBody)
    }

    override fun joinResearchActivity(requestBody: RequestBody): Observable<BaseBean<Any>> {
        return apiService.joinResearchActivity(requestBody)
    }

    override fun uploadResearchNote(requestBody: RequestBody): Observable<BaseBean<Any>> {
        return apiService.uploadResearchNote(requestBody)
    }

    override fun getRoomUuidAndToken(requestBody: RequestBody): Observable<BaseBean<WhiteboardTokenBean>> {
        return apiService.getRoomUuidAndToken(requestBody)
    }


    override fun getWhiteboardToken(uuid: String,requestBody: RequestBody): Observable<String> {
        return apiService.getWhiteRoomToken(uuid,requestBody)
    }

    override fun getRoomToken(requestBody: RequestBody): Observable<BaseBean<RoomTokenBean>> {
        return apiService.getRoomToken(requestBody)
    }

    override fun deleteResearchNote(requestBody: RequestBody): Observable<BaseBean<Any>> {
        return apiService.deleteResearchNote(requestBody)
    }

    override fun sharePics(requestBody: RequestBody): Observable<BaseBean<String>> {
        return apiService.sharePics(requestBody)
    }

    override fun getRoomNote(requestBody: RequestBody): Observable<BaseBean<RoomNoteBean>> {
        return apiService.selectTeacherNote(requestBody)
    }

    override fun getLiveState(requestBody: RequestBody): Observable<BaseBean<LiveStateBean>> {
        return apiService.getLiveState(requestBody)
    }


}